Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

androidApp/src/google/kotlin/org/meshtastic/app/map/component/WaypointMarkers.kt 2d20cd8a4708e2ef66e98d5259f3a97ec93f240a (2d20cd8a) Text, 5.02 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.map.component

Tff7b72import T7ee787androidx.compose.foundation.layout.padding
Tff7b72import T7ee787androidx.compose.material3.Text
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.LaunchedEffect
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.compose.ui.unit.dp
Tff7b72import T7ee787androidx.compose.ui.unit.sp
Tff7b72import T7ee787com.google.android.gms.maps.model.LatLng
Tff7b72import T7ee787com.google.maps.android.compose.MapsComposeExperimentalApi
Tff7b72import T7ee787com.google.maps.android.compose.Marker
Tff7b72import T7ee787com.google.maps.android.compose.rememberComposeBitmapDescriptor
Tff7b72import T7ee787com.google.maps.android.compose.rememberUpdatedMarkerState
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.app.map.convertIntToEmoji
Tff7b72import T7ee787org.meshtastic.core.model.geofence.toGeofence
Tff7b72import T7ee787org.meshtastic.core.model.isLocked
Tff7b72import T7ee787org.meshtastic.core.model.isModifiableBy
Tff7b72import T7ee787org.meshtastic.core.model.util.GeoConstants.DEG_D
Tff7b72import T7ee787org.meshtastic.core.model.util.waypointIconOrDefault
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.geofence
Tff7b72import T7ee787org.meshtastic.feature.map.BaseMapViewModel
Tff7b72import T7ee787org.meshtastic.proto.Waypoint

Tf0883e@OptInTb4b4b4(Te6edf3MapsComposeExperimentalApiTff7b72::Te6edf3classTb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffWaypointMarkersTb4b4b4(
Te6edf3displayableWaypointsTb4b4b4: Te6edf3ListTff7b72<Te6edf3WaypointTff7b72>Tb4b4b4,
Te6edf3mapFilterStateTb4b4b4: Te6edf3BaseMapViewModelTb4b4b4.Te6edf3MapFilterStateTb4b4b4,
Te6edf3myNodeNumTb4b4b4: Tffa657IntTb4b4b4,
Te6edf3onEditWaypointRequestTb4b4b4: Tb4b4b4(Te6edf3WaypointTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3onDeleteWaypointRequestTb4b4b4: Tb4b4b4(Te6edf3WaypointTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3isMyWaypointTb4b4b4: Tb4b4b4(Tffa657IntTb4b4b4) Tff7b72-Tff7b72> Tffa657BooleanTb4b4b4,
Te6edf3onShowGeofenceInfoTb4b4b4: Tb4b4b4(Te6edf3WaypointTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3selectedWaypointIdTb4b4b4: Tffa657Int? Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3mapFilterStateTb4b4b4.Te6edf3showWaypointsTb4b4b4) Tb4b4b4{
Te6edf3displayableWaypointsTb4b4b4.Te6edf3forEach Tb4b4b4{ Te6edf3waypoint Tff7b72-Tff7b72>
Tff7b72val Te6edf3markerState Tff7b72=
Te6edf3rememberUpdatedMarkerStateTb4b4b4(
Te6edf3position Tff7b72= Te6edf3LatLngTb4b4b4(Tb4b4b4(Te6edf3waypointTb4b4b4.Te6edf3latitude_i Tff7b72?: T79c0ff0Tb4b4b4) Tff7b72* Te6edf3DEG_DTb4b4b4, Tb4b4b4(Te6edf3waypointTb4b4b4.Te6edf3longitude_i Tff7b72?: T79c0ff0Tb4b4b4) Tff7b72* Te6edf3DEG_DTb4b4b4)Tb4b4b4,
Tb4b4b4)

Te6edf3LaunchedEffectTb4b4b4(Te6edf3selectedWaypointIdTb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3selectedWaypointId Tff7b72=Tff7b72= Te6edf3waypointTb4b4b4.Te6edf3idTb4b4b4) Tb4b4b4{
Te6edf3markerStateTb4b4b4.Te6edf3showInfoWindowTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Tff7b72val Te6edf3iconCodePoint Tff7b72= Te6edf3waypointTb4b4b4.Te6edf3iconTb4b4b4.Te6edf3waypointIconOrDefaultTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3emojiText Tff7b72= Te6edf3convertIntToEmojiTb4b4b4(Te6edf3iconCodePointTb4b4b4)
Tff7b72val Te6edf3icon Tff7b72=
Te6edf3rememberComposeBitmapDescriptorTb4b4b4(Te6edf3iconCodePointTb4b4b4) Tb4b4b4{
Te6edf3TextTb4b4b4(Te6edf3text Tff7b72= Te6edf3emojiTextTb4b4b4, Te6edf3fontSize Tff7b72= T79c0ff3T79c0ff2.Te6edf3spTb4b4b4, Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3paddingTb4b4b4(T79c0ff2.Te6edf3dpTb4b4b4)Tb4b4b4)
Tb4b4b4}

T8b949e// Non-visual cue: the geofence is otherwise only an orange overlay, so surface it in the marker's
T8b949e// accessible snippet for screen-reader and color-challenged users.
Tff7b72val Te6edf3description Tff7b72= Te6edf3waypointTb4b4b4.Te6edf3descriptionTb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff'\n'Tb4b4b4, Ta5d6ff' 'Tb4b4b4)Tb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff'\b'Tb4b4b4, Ta5d6ff' 'Tb4b4b4)
Tff7b72val Te6edf3snippet Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3waypointTb4b4b4.Te6edf3toGeofenceTb4b4b4(Tb4b4b4) Tff7b72!Tff7b72= Tff7b72nullTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3geofenceLabel Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3geofenceTb4b4b4)
Tff7b72if Tb4b4b4(Te6edf3descriptionTb4b4b4.Te6edf3isBlankTb4b4b4(Tb4b4b4)Tb4b4b4) Te6edf3geofenceLabel Tff7b72else Ta5d6ff"Tffd700$Te6edf3descriptionTa5d6ff · Tffd700$Te6edf3geofenceLabelTa5d6ff"
Tb4b4b4} Tff7b72else Tb4b4b4{
Te6edf3description
Tb4b4b4}

T8b949e// Lock cue in the info-window title (parity with the fdroid marker), so a locked waypoint is
T8b949e// identifiable before it is tapped.
Tff7b72val Te6edf3cleanName Tff7b72= Te6edf3waypointTb4b4b4.Te6edf3nameTb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff'\n'Tb4b4b4, Ta5d6ff' 'Tb4b4b4)Tb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff'\b'Tb4b4b4, Ta5d6ff' 'Tb4b4b4)
Tff7b72val Te6edf3title Tff7b72= Tff7b72if Tb4b4b4(Te6edf3waypointTb4b4b4.Te6edf3isLockedTb4b4b4) Ta5d6ff"Tffd700${Te6edf3convertIntToEmojiTb4b4b4(Te6edf3LOCKTb4b4b4)Tffd700}Ta5d6ff Tffd700$Te6edf3cleanNameTa5d6ff" Tff7b72else Te6edf3cleanName

Te6edf3MarkerTb4b4b4(
Te6edf3state Tff7b72= Te6edf3markerStateTb4b4b4,
Te6edf3icon Tff7b72= Te6edf3iconTb4b4b4,
Te6edf3title Tff7b72= Te6edf3titleTb4b4b4,
Te6edf3snippet Tff7b72= Te6edf3snippetTb4b4b4,
Te6edf3visible Tff7b72= Tff7b72trueTb4b4b4,
Te6edf3onInfoWindowClick Tff7b72= Tb4b4b4{
Tff7b72when Tb4b4b4{
T8b949e// Foreign geofences: read-only view hosting the receiver-local crossing-alert opt-in.
Te6edf3waypointTb4b4b4.Te6edf3toGeofenceTb4b4b4(Tb4b4b4) Tff7b72!Tff7b72= Tff7b72null Tff7b72&Tff7b72& Tff7b72!Te6edf3isMyWaypointTb4b4b4(Te6edf3waypointTb4b4b4.Te6edf3idTb4b4b4) Tff7b72-Tff7b72> Te6edf3onShowGeofenceInfoTb4b4b4(Te6edf3waypointTb4b4b4)

Te6edf3waypointTb4b4b4.Te6edf3isModifiableByTb4b4b4(Te6edf3myNodeNumTb4b4b4) Tff7b72-Tff7b72> Te6edf3onEditWaypointRequestTb4b4b4(Te6edf3waypointTb4b4b4)

T8b949e// Locked to someone else: the editor could never broadcast a change, whether we are connected
T8b949e// or not, but our local copy is still ours to remove — so offer that instead.
Tff7b72else Tff7b72-Tff7b72> Te6edf3onDeleteWaypointRequestTb4b4b4(Te6edf3waypointTb4b4b4)
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

Tff7b72private Tff7b72const Tff7b72val Te6edf3LOCK Tff7b72= T79c0ff0Te6edf3x1F512 T8b949e// Unicode for Lock

Served by rngit 1.5.0 - Generated in 0.06s